<?php
/*
  $Id$

  osCommerce, Open Source E-Commerce Solutions
  http://www.oscommerce.com

  Copyright (c) 2010 osCommerce

  Released under the GNU General Public License
*/

  require('includes/application_top.php');

  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CONTACT_US);

  if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'send') && isset($HTTP_POST_VARS['formid']) && ($HTTP_POST_VARS['formid'] == $sessiontoken)) {
    $error = false;

    $name = tep_db_prepare_input($HTTP_POST_VARS['name']);
    $email_address = tep_db_prepare_input($HTTP_POST_VARS['email']);
    $enquiry = tep_db_prepare_input($HTTP_POST_VARS['enquiry']);

    if (!tep_validate_email($email_address)) {
      $error = true;

      $messageStack->add('contact', ENTRY_EMAIL_ADDRESS_CHECK_ERROR);
    }

    $actionRecorder = new actionRecorder('ar_contact_us', (tep_session_is_registered('customer_id') ? $customer_id : null), $name);
    if (!$actionRecorder->canPerform()) {
      $error = true;

      $actionRecorder->record(false);

      $messageStack->add('contact', sprintf(ERROR_ACTION_RECORDER, (defined('MODULE_ACTION_RECORDER_CONTACT_US_EMAIL_MINUTES') ? (int)MODULE_ACTION_RECORDER_CONTACT_US_EMAIL_MINUTES : 15)));
    }

    if ($error == false) {
      tep_mail(STORE_OWNER, STORE_OWNER_EMAIL_ADDRESS, EMAIL_SUBJECT, $enquiry, $name, $email_address);

      $actionRecorder->record();

      tep_redirect(tep_href_link(FILENAME_CONTACT_US, 'action=success'));
    }
  }

  $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_CONTACT_US));

  require(DIR_WS_INCLUDES . 'template_top.php');
?>

<?php
  if ($messageStack->size('contact') > 0) {
    echo $messageStack->output('contact');
  }

  if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'success')) {
?>
<div style="text-align:left; color:#FFF">
	  <?php echo nl2br(TEXT_SUCCESS); ?>
</div>
<?php
  } else {
?>


<div class="left_contain">
    <?php include('includes/templates/centrum/col_right_homepage.php'); ?>
</div>

<div class="right_contain">
    
    
</div>

<div class="right_contain">
    <div class="title">Contact</div>
    <div class="clear_20"></div>
	<script type="text/javascript" src="ext/googlemap/maps"></script>
    <script type="text/javascript" src="ext/googlemap/jquery_003.js"></script>
    <script type="text/javascript" src="ext/googlemap/jquery_002.js"></script>
    <script type="text/javascript" src="ext/googlemap/jquery_004.js"></script>
    <script type="text/javascript">
    $(function() {
        $("#map3").gMap({ markers: [{ latitude: 50.7934,
                                      longitude: 3.1226,
                                    }],
                          zoom: 13 });
    });
    </script>

	<div style="width:450px; overflow:hidden;">
    	<table cellpadding="0" cellspacing="0" border="0" class="contact">
            <tr>
                <td width="105"></td>
                <td width="95"></td>
                <td width="20"></td>
                <td width="105"></td>
                <td width="125"></td>
            </tr>
            <tr>
                <td colspan="2"><h4>Adres</h4></td>
                <td></td>
                <td colspan="2"><h4>Openingsuren</h4></td>
            </tr>
            <tr>
            	<td colspan="2">Geraardbergsesteenweg 544</td>
                <td></td>
                <td><h4>Dinsdag tot</h4></td>
                <td>9hr30 tot 12hr00</td>
            </tr>
            <tr>
            	<td colspan="2">B - Voorde (Ninove)</td>
                <td></td>
                <td><h4>vrijdag </h4></td>
                <td>13hr30 tot 18hr00</td>
            </tr>
            <tr>
            	<td colspan="5"><div class="clear_20"></div></td>
            </tr>
            <tr>
            	<td colspan="2">T : 054 50 00 01</td>
                <td></td>
                <td></td>
                <td></td>
            </tr>
            <tr>
            	<td colspan="2">F : 054 50 29 63</td>
                <td></td>
                <td><h4>Zaterdag</h4></td>
                <td>9hr30 tot 12hr00</td>
            </tr>
            <tr>
            	<td colspan="2">E : info@dbcentrum.be</td>
                <td></td>
                <td><h4>Zaterdag</h4></td>
                <td>13hr30 tot 18hr00</td>
            </tr>
        </table>
        <div class="clear_20"></div>
        <div id="map3" style=" height: 400px; border: 1px solid #CCC; overflow: hidden; position: relative; background-color: rgb(229, 227, 223);"></div>
    </div>
</div>

<?php
  }

  require(DIR_WS_INCLUDES . 'template_bottom.php');
  require(DIR_WS_INCLUDES . 'application_bottom.php');
?>
